import {lazy} from "react"
import {Navigate} from "react-router-dom"
import { FriendsO, HomeO, Search, SettingO } from '@react-vant/icons'
const Login = lazy(()=>import("../pages/login"))
const Home = lazy(()=>import("../pages/Index/home"))
const ShopHome = lazy(()=>import("../pages/Index/shophome"))
const Deatil = lazy(()=>import("../pages/detail"))
const Shopcar = lazy(()=>import("../pages/Index/shocar"))
const Address = lazy(()=>import("../pages/Index/address"))
const Addaddress = lazy(()=>import("../pages/addaddress"))
export const Homechildren = [
    {
        path:"/home/shophome",
        element:<ShopHome></ShopHome>,
        tit:"首页",
        icon:<FriendsO/>
    },
    {
        path:"/home/shopcar",
        element:<Shopcar></Shopcar>,
        tit:"购物车",
        icon:<HomeO/>
    },
    {
        path:"/home/address",
        element:<Address></Address>,
        tit:"我的地址",
        icon:<HomeO></HomeO>
    },
    {
        path:"/home",
        element:<Navigate to="/home/shophome"></Navigate>
    }

]

const routerconfig = [
    {
        path:"/login",
        element:<Login></Login>
    },
    {
        path:"/home",
        element:<Home></Home>,
        children:Homechildren
    },
    {
        path:"/detail",
        element:<Deatil></Deatil>
    },
    {
        path:"/addaddress",
        element:<Addaddress></Addaddress>
    },
    {
        path:"/",
        element:<Navigate to="/home"></Navigate>
    }
]
export default routerconfig